package com.etoak.stock.config;

import com.etoak.stock.pojo.vo.StockInfoConfig;
import com.etoak.stock.utils.IdWorker;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

@Configuration
@EnableConfigurationProperties(StockInfoConfig.class) //开启相关的配置类的加载
public class CommonConfig {



    /*
    * 基于雪花算法的配置
    * */
    @Bean
    public IdWorker idWorker(){
        /*
        * 参数1 机器id
        * 参数2 机房id
        * 机房和机器编号一般有运维人员进行唯一标识
        * */
        return new IdWorker(1L,2L);
    }
}
